Skip to content

Conversation

@konrad0960
Copy link

Description

Voting power feature
Purpose: Track validator voting power using an Exponential Moving Average (EMA) of their stake over time, preventing sudden stake changes from immediately affecting governance weight.

Key Components:

  • EMA-based voting power calculation (updated each epoch)
  • Per-subnet enable/disable with 14-day grace period
  • Configurable alpha parameter for EMA smoothness
  • Voting power transfers on hotkey swap
  • EVM precompile for smart contract access

Extrinsics: enable_voting_power_tracking, disable_voting_power_tracking, sudo_set_voting_power_ema_alpha

Storage: VotingPower, VotingPowerTrackingEnabled, VotingPowerDisableAtBlock, VotingPowerEmaAlpha

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have run ./scripts/fix_rust.sh to ensure my code is formatted and linted correctly
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Additional Notes

I’ve attempted to run the VotingPower precompile EVM tests locally but encountered multiple Node.js compatibility issues with the polkadot-api dependencies.
Being unable to resolve them I want to give CI a try
That being said the unit tests written cover the core logic.

@konrad0960 konrad0960 changed the title commit Cargo.lock Voting Power EMA Dec 1, 2025
@open-junius
Copy link
Contributor

Enabled the CI process, to check if EVM test is runnable for PR.

@konrad0960
Copy link
Author

Enabled the CI process, to check if EVM test is runnable for PR.

can we try again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants